package sv.gob.mh.dgii.dao.rc;

import org.springframework.stereotype.Repository;
import sv.gob.mh.dgii.dao.hibernate.HibernateDaoNoCrudImpl;
import sv.gob.mh.dgii.model.RcRuc;

@Repository
public class RiskDaoImpl extends HibernateDaoNoCrudImpl implements RiskDao {
		
	public String getRiskDB(RcRuc contrib)throws Exception {
		String sql ="{ ? = call pkg_ruc_utils.get_risk( ?,?,?,?,?,?) }";
		
		java.sql.Date date = new java.sql.Date(contrib.getFnacConst().getTime());		
		Object[] params = new Object[7];
		params[0] = new String();
		params[1] = contrib.getSnombres();
		params[2] = contrib.getS1apeRasoc();
		params[3] = contrib.getS2apeAbrev();
		params[4] = contrib.getTbMunicipio().getId().getCdepartamento();
		params[5] = contrib.getTbMunicipio().getId().getCmunicipio();
		params[6] = date;
		Object str= super.executeFunction(sql, params);
		return (String)str;
	}

}
//class